1. Technical Field
The present invention relates to an improved method and system for data processing in general and, in particular, to an improved method and system for processing non-native instructions within a computer system. Still more particularly, the present invention relates to an improved method and system for executing non-native mode-sensitive instructions within a computer system.
2. Description of the Prior Art
The World Wide Web, or as it is simply known as, the "Web," has dramatically changed the on-line world and continues to grow in popularity. As a communications system, the Web allows information providers to distribute and collect information globally and instantly. For users, the Web is a dynamic view into the works and ideas of millions of people worldwide. Through a system of hypertext, users of the Web are able to select and view information from all over the Web. While the hypertext system gives Web users a high degree of selectivity over the information they choose to view, their level of interactivity with that information is low. Even with improvements such as hypermedia, which opens up many new kinds of sensory input for the Web users, including access to graphics and videos, the Web itself still lacks a true interactivity, that is, a kind of real-time, dynamic, and visual interaction between Web users and applications.
Java.sup.1 brings this missing interactivity to the Web. With Java, animations and interactive applications on the Web become feasible. Java's features enrich communication, information, and interaction on the Web by enabling the distribution of executable content-rather than just Hypertext Markup Language (HTML) pages and hypermedia files-among Web users. This ability to distribute executable content is one of the powerful features of Java.
In order to view and interact with animations and the interactive applications on the Web, a Web user must have a computer installed with a Java-enabled Web browser. Even so, because Java has an instruction set that is different from the instruction set of most, if not all, processors utilized within a Web user's personal computer, Java instructions typically cannot be executed in their original bytecode form. Hence, some form of translation from the Java instruction set to an instruction set associated with the processor FNT .sup.1 Java is a trademark of Sun Microsystems, and is also the name of a programming language developed by Sun Microsystems. within the personal computer is required. Conventionally, an instruction set associated with a particular processor is called a "native" instruction set to that computer, while an instruction set that is not specifically developed for that particular processor is called a "non-native" instruction set to that particular computer. In this case, Java would be a non-native instruction set with respect to the Web user's computer.
Most instruction sets have instructions that affect the way subsequent instructions are suppose to behave. These instructions are known as "mode-altering" instructions. Not surprisingly, there is one mode-altering instruction called "WIDE" in the Java instruction set, which affects the way an immediate subsequent instruction executes. Only certain instructions out of the entire Java instruction set are allowed to follow this WIDE instruction. These certain instructions include ILOAD, FLOAD, ALOAD, LLOAD, DLOAD, ISTORE, FSTORE, ASTORE, LSTORE, DSTORE, and RET. For the sake of convenience, these "mode-sensitive" instructions that are permissible to follow the WIDE instruction will be referred to as "wideable" instructions.
When a wideable instruction is encountered, there are two different sets of native code that could be generated, based on whether or not the preceding instruction is a WIDE instruction. One method of handling this is to have the native code for the WIDE instruction set a condition register in the processor. Then, the native code for wideable instructions begins with a test of the condition register and branches accordingly. This method is not only slow, but it also requires the execution of several native instructions for the testing of the condition register before branching. It further requires the generation of native instructions for both the widened and the unwidened versions of the wideable instructions, which takes up space in the primary cache, and ultimately leads to reduction in system performance.
Due to the large number of wideable instructions that are commonly encountered in a program written in Java, the execution time of these wideable instructions has a large impact on system performance. Consequently, it would be desirable to provide an improved method for executing these types of non-native wideable instructions within a computer system.